import './OrderText.scss';
import orderStatusClose from '@/assets/medium/orderStatus_close.png';
import orderStatusNone from '@/assets/medium/orderStatus_none.png';
import orderStatusIng from '@/assets/medium/orderStatus_ing.png';
import orderStatusComplete from '@/assets/auditProcess/status4.png';

export default {
  name: 'MediumOrderText',
  props: {
    orderStatus: {
      type: Number,
      default: 1
    }
  },
  data() {
    return {
      orderStatusClose, orderStatusNone, orderStatusIng, orderStatusComplete
    };
  },
  methods: {
    mediumOrderStatus(status) {
      if (!status || status === '') return '';
      switch (Number(status)) {
        case 1:
          return (<span class='status-icon-text status-none'><img src={this.orderStatusNone} /> 询单待确认</span>);
        case 2:
          return (<span class='status-icon-text status-ing'><img src={this.orderStatusIng} /> 询单执行中</span>);
        case 3:
          return (<span class='status-icon-text status-complete'><img src={this.orderStatusComplete} /> 询单已完成</span>);
        case 4:
          return (<span class='status-icon-text status-close'><img src={this.orderStatusClose} />询单已关闭</span>);
        default:
          return (<span class='status-icon-text status-none'><img src={this.orderStatusNone} /> 询单待确认</span>);
      }
    }
  },
  render() {
    return this.mediumOrderStatus(this.orderStatus);
  }
};
